<table id="table-5" style="width: 100%;">
    <thead>
        <tr>
            <th class="center">Product Name</th>
            <th class="center">Price</th>
            <th class="center">Quantity</th>
            <th class="center">Total Price</th>
        </tr>
    </thead>
    
    <tbody>                                    
        <?php $sum = 0; foreach($this->cart as $row){ $total_price = $row['qty']*$row['prod']->price?>
        <tr>
            <td><?=$row['prod']->name?></td>
            <td><?="$".number_format($row['prod']->price,2,".","")?></td>
            <td><?=$row['qty']?></td>
            <td><?="$".number_format($total_price,2,".","")?></td>
        </tr>
        <?php $sum+= $total_price;} ?>   
    </tbody>
    
    <tfoot>
        <tr>
            <td colspan="3" style="font-weight: bold;">Sum</td>
            <td><?="$".number_format($sum,2,".","")?></td>
        </tr>
    </tfoot>
</table>